package com.cj.designpattern.factory.method.impl;

import com.cj.designpattern.factory.method.MyAbstractMessage;

/**
 * ClassName: MyMessageEmail <br/>
 * Function: 工厂方法模式_email产品  <br/>
 * date: 2018/04/27 17:31 <br/>
 *
 * @author chenj
 * @version 1.0.0
 * @since JDK 1.8
 */
public class MyMessageEmail extends MyAbstractMessage {

    @Override
    public void sendMesage() throws Exception {
        if (null == getMessageParam() || null == getMessageParam().get("EMAIL")
                || "".equals(getMessageParam().get("EMAIL"))) {
            throw new Exception("发送短信,需要传入EMAIL参数");
        }
        System.out.println("我是邮件，发送通知给" + getMessageParam().get("EMAIL"));
    }
}
